package translated;

import java.util.List;
import edu.pku.sei.modeler.jet.model.*;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.jet.util.*;

public class SampleActionGen
{
  protected static String nl;
  public static synchronized SampleActionGen create(String lineSeparator)
  {
    nl = lineSeparator;
    SampleActionGen result = new SampleActionGen();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "/**" + NL + " * Copyright (c) Software Institute of PKU" + NL + " * All rights reserved. " + NL + " * This program and the accompanying materials" + NL + " * are made available under the terms of the Eclipse Public License v1.0" + NL + " * which accompanies this distribution, and is available at" + NL + " * http://www.eclipse.org/legal/epl-v10.html" + NL + " *" + NL + " */" + NL + "package ";
  protected final String TEXT_2 = ";" + NL + "" + NL + "import org.eclipse.jface.action.Action;" + NL + "import org.eclipse.jface.dialogs.MessageDialog;" + NL + "import org.eclipse.ui.IWorkbenchPage;" + NL + "import org.eclipse.ui.PlatformUI;" + NL + "" + NL + "import edu.pku.sei.modeler.model.core.MetaPackage;" + NL + "import edu.pku.sei.modeler.model.structure.MetaDiagram;" + NL + "import edu.pku.sei.modeler.images.ImageProvider;" + NL + "import edu.pku.sei.modeler.project.AbstractModelingProject;" + NL + "import edu.pku.sei.modeler.actions.OpenDiagramAction;" + NL + "import edu.pku.sei.modeler.actions.MetaTreeViewerActionGroup;" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " *" + NL + " */" + NL + "public class SampleAction extends Action {" + NL + "\tprivate Object obj;" + NL + "\tprivate IWorkbenchPage workbenchPage;" + NL + "\t" + NL + "\tpublic SampleAction(){" + NL + "\t\tsuper();" + NL + "\t\tthis.setText(\"Sample Action\");" + NL + "\t\tsetToolTipText(\"Sample Action\");" + NL + "\t\tthis.setImageDescriptor(ImageProvider.getImageDescriptor(ImageProvider.FIELD_PUBLIC_IMAGE));" + NL + "\t\tthis.workbenchPage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();" + NL + "\t}" + NL + "\tpublic void setTreeObj(Object obj) {" + NL + "\t\tthis.obj = obj;" + NL + "\t}" + NL + "\tpublic void setWorkbenchPage(IWorkbenchPage workbenchPage) {" + NL + "\t\tthis.workbenchPage = workbenchPage;" + NL + "\t}" + NL + "\tpublic void run()" + NL + "\t{" + NL + "\t\t// ?????????????" + NL + "\t\tMessageDialog.openInformation(workbenchPage.getActivePart().getSite().getShell()," + NL + "\t\t\t\t\"Sample\", \"Your selected:\"+obj);" + NL + "\t}" + NL + "\t" + NL + "}";
  protected final String TEXT_3 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append(TEXT_1);
    stringBuffer.append(ModelerConstants.pkgBase + "." + ModelerConstants.actionBase);
    stringBuffer.append(TEXT_2);
    stringBuffer.append(TEXT_3);
    return stringBuffer.toString();
  }
}
